// 用户表接口
const getOpenId = require('./userApi/getOpenId/index');
const setOpenId = require('./userApi/setOpenId/index');
const getUser = require('./userApi/getUser/index');
const setUserName = require('./userApi/setUserName/index');
const setImgUrl = require('./userApi/setImgUrl/index');
// 用户认证
const putRz = require('./rzApi/putRz/index');
const passRz = require('./rzApi/passRz/index');
const getRz = require('./rzApi/getRz/index');
// 商品表接口
const putProduct = require('./productApi/putProduct/index');
const getProduct = require('./productApi/getProduct/index');
const buy = require('./productApi/buy/index');
const like = require('./productApi/like/index');
const deleteApi = require('./productApi/deleteApi/index');
const cancelApi = require('./productApi/cancelApi/index');
// 聊天表接口
const sendMsg = require('./chatApi/sendMsg/index');
const getMsg = require('./chatApi/getMsg/index');
const getMyMsg = require('./chatApi/getMyMsg/index');
const isRead = require('./chatApi/isRead/index');


// 云函数入口函数
exports.main = async (event, context) => {
  switch (event.type) {
    case 'getOpenId':
      return await getOpenId.main(event, context);
    case 'setOpenId':
      return await setOpenId.main(event, context);
    case 'getUser':
      return await getUser.main(event, context);
    case 'setUserName':
      return await setUserName.main(event, context);
    case 'setImgUrl':
      return await setImgUrl.main(event, context);
    case 'putProduct':
      return await putProduct.main(event, context);
    case 'getProduct':
      return await getProduct.main(event, context);
    case 'sendMsg':
      return await sendMsg.main(event, context);
    case 'getMsg':
      return await getMsg.main(event, context);
    case 'getMyMsg':
      return await getMyMsg.main(event, context);
    case 'isRead':
      return await isRead.main(event, context);
    case 'buy':
      return await buy.main(event, context);
    case 'like':
      return await like.main(event, context);
    case 'deleteApi':
      return await deleteApi.main(event, context);
    case 'cancelApi':
      return await cancelApi.main(event, context);
    case 'putRz':
      return await putRz.main(event, context);
    case 'passRz':
      return await passRz.main(event, context);
    case 'getRz':
      return await getRz.main(event, context);
  }
};
        
